#ifndef SAFE_DELETE_HEADER_H
#define SAFE_DELETE_HEADER_H

template<typename T> inline void safe_delete(T *& p) {
    if (p) {
        /*
        if (::IsBadReadPtr(p, sizeof(T)) || ::IsBadWritePtr(p, sizeof(T)))
            ATLASSERT(false);
        */
        delete p;
        p = NULL;
    }
}

#endif